﻿using Is.Ex;

namespace Is
{
    public static class IsArrayFluentExtensions
    {
        public static bool Empty<T>(this IIs<T[]> iser)
        {
            return iser.Apply(
                t => t.Contains().Zero(),
                t => !t.Contains().Zero());
        }

        public static bool NullOrEmpty<T>(this IIs<T[]> iser)
        {
            return iser.Apply(
                t => Core.Is.Null(t) || t.Contains().Zero(),
                t => Core.Is.NotNull(t) && !t.Contains().Zero());
        }

        public static ContainsEnumerable<T> Contains<T>(this IIs<T[]> iser)
        {
            return new ContainsEnumerable<T>(iser.Target, iser.Negate);
        }
    }
}